package ace.module.weixin.core.impl.dao.repository;


import ace.cmp.spring.data.jdbc.querydsl.core.repository.QuerydslJdbcBaseRepository;
import ace.module.weixin.core.impl.constant.WeixinCoreConstant;
import ace.module.weixin.core.impl.dao.entity.WxsCache;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springframework.stereotype.Repository;

/**
 * 微信缓存数据,保存accessToken、ticket等有时效数据 repository.
 *
 * @author Caspar
 */
@DS(WeixinCoreConstant.DEFAULT_DATA_SOURCE_NAME)
@Repository
public interface WxsCacheRepository extends QuerydslJdbcBaseRepository<WxsCache,Long> {

  WxsCache getByKeyAndExpireTimeAfterAndDeleteFlag(String key, long expireTime, long deleteFlag);

  WxsCache getByKeyAndDeleteFlag(String key, long deleteFlag);

}